<template>
    <div style="padding-top: 59px;">
        <div class="top-panel w" style="padding: 0 15px;margin-top: 20px;">
            <div class="clearfix">
                <div class="title-big fl">工作台<span class="title-tip">在这里，可以集中管理您发布的项目信息</span></div>
                <div class="fr"><router-link class="morebtn" to="/publishtype">免费发布需求</router-link></div>
            </div>
        </div>
        <div class="mtb-large">
            <div class="w">
                <el-row :gutter="20">
                    <el-col :span="5">
                        <div class="left-menu-box panel-bg">
                            <ul class="menus">
                                <li v-for="(item,index) in menulist" :key="index">
                                    <h4>{{item.type}}</h4>
                                    <ul class="submenus">
                                        <li @click="handselect" v-for="(level,ind) in item.level" :key="ind">
                                            <router-link :to="level.path">{{level.name}}</router-link>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </div>
                    </el-col>
                    <el-col :span="19">
                        <router-view v-if="routerAlive"></router-view>
                    </el-col>
                </el-row>
            </div>
        </div>
    </div>
</template>


<script>

    import '../../assets/css/workbench.css'
    export default {
        data(){
            return{
                routerAlive: true,  //渲染状态
                menulist:[
                    {
                        'type' :'项目',
                        'level' :[
                            {'name': '接包项目','path': '/receiveditem'},
                            {'name': '发包项目','path': '/senditem'},
                            {'name': '待发布','path': '/readypushitem'}
                        ]
                    },
                    {
                        'type' :'源码',
                        'level' :[
                            {'name': '已发布','path': '/sendcode'},
                            {'name': '待发布','path': '/readypushcode'}
                        ]
                    },
                    // {'type' :'合作评价','level' :[{'name': '我的评价','path': '/evaluate'}]},
                ]
            }
        },
        methods: {
            // 切换菜单选项
            handselect(){
                this.routerAlive = false;
                this.$nextTick(()=>{
                    this.routerAlive = true;
                });
            },
        },
        mounted(){
            
        },
    }
</script>
